package com.sabo.controller;

import com.sabo.feign.BClient;
import jakarta.annotation.Resource;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class AController {

    @Resource
    private BClient bClient;

    @GetMapping("/err")
    public ResponseEntity<String> err() {
        return bClient.err();
    }

    @GetMapping("/ok")
    public ResponseEntity<String> ok() {
        return bClient.ok();
    }

    @GetMapping("/sleep")
    public String sleep() {
        return bClient.sleep();
    }

    @GetMapping("/exception")
    public Integer exception(@RequestParam Integer a, @RequestParam Integer b) {
        return bClient.exception(a,b);
    }

}
